package guitu;

import java.util.Random;

public class Rabbit extends Thread {
	String name;
	int i;

	Rabbit(String name) {
		this.name = name;
		i = 0;

	}

	public void run() {
		while (true) {
		
			System.out.println(name + "休息" + 10 + "秒");

			try {
				sleep(10000);
			} catch (InterruptedException e) {

				e.printStackTrace();
			}

			System.out.println(name + "跑了" + (i = i + 10));
			if (i >= 20) {
				System.out.println(name + "跑过了终点");
			}
		}

	}
}
